package com.vdong.common.oauth.common.enums;

public enum AuthorizeTypeEnum {
    //公众号
    Open(1, "公众号"),
    //小程序
    Mini(2, "小程序");
    private int code;
    private String desc;

    AuthorizeTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static AuthorizeTypeEnum getEnum(int value) {
        for (AuthorizeTypeEnum authorizeTypeEnum : AuthorizeTypeEnum.values()) {
            if (authorizeTypeEnum.getCode() == value) {
                return authorizeTypeEnum;
            }
        }
        return Mini;
    }
}
